// 引入封装好的接口
import {getMenuList} from '../../../request/api'
const state = {
    menulist:[]
}

const getters = {
    getMenu(state){
        return state.menulist
    }
}

const mutations = {
    REQ_MENULIST(state,payload){
        state.menulist=payload
    }
}

const actions = {
    getMenuAction({commit}){
        getMenuList().then(res => {
            // console.log(res, '////////');
            commit('REQ_MENULIST',res.list)
        })
    }
}

export default {
    state,
    getters,
    mutations,
    actions,
    namespaced:true
}